package com.eke.action.user;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Component;

import com.jason.mvc.annotations.Namespace;
import com.jason.mvc.annotations.RequestMapping;
import com.jason.mvc.annotations.Result;
import com.jason.mvc.bean.config.enums.ResultType;
import com.jason.mvc.utils.ApplicationContext;

@Namespace("/")
@Component("logout")
public class Logout {

	/**
	 * 退出登陆
	 */
	@RequestMapping("logout")
	@Result(name = "logout", value = "index.jsp",type=ResultType.REDIRECT)
	public String logout() {
		HttpSession session = ApplicationContext.getSession();
		session.invalidate();
		return "logout";
	}
}
